// pages/mine/mine.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
    zhuangtai:false,
    message: "签到",
    xuewangbi:13,
    tianmizhi:10,
    index:"0",
    bili:10,
    username:''
  },
  showmessage(){
    wx.showToast({
      title:"签到成功，雪王币+5，甜蜜值+1",
      icon: 'none',
      duration:2000
    })
    this.setData({
      message:'已签到',
      tianmizhi:this.data.tianmizhi+1,
      index: 1,
      
    })
    var xuewangbi = wx.getStorageSync('xuewangbi');
        xuewangbi = 18;
        wx.setStorageSync('xuewangbi', xuewangbi);


        var bili= wx.getStorageSync('bili');
        bili = 55;
        wx.setStorageSync('bili', bili);
  },
  duihuan(){
    if(this.data.zhuangtai==true){
    wx.navigateTo({
      url: '/pages/change/change',
    })
 }
      else{
        wx.navigateTo({
           url: '/pages/sanduo/sanduo', 
        })
      }
 
},

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad() {
    this.setData({
  zhuangtai:wx.getStorageSync('zhuangtai'),
  zhuangtaihou:wx.getStorageSync('zhuangtaihou'),
  username:wx.getStorageSync('userinfo').nickName,
  bili:wx.getStorageSync('bili'),
  xuewangbi:wx.getStorageSync('xuewangbi'),
  touxiang:wx.getStorageSync('userinfo').avatarUrl
})
}
})